from info import redis_store
from . import index_blue
from flask import current_app,render_template
import logging

@index_blue.route('/',methods=["GET","POST"])
def helloworld():
    # 测试redis存储数据
    # redis_store.set("name","laowang")
    # print(redis_store.get("name"))
    # # 测试session存储数据
    # session['product'] = 'lenovo'
    # print(session.get("product"))

    # logging.debug("调试信息")
    # logging.info("详细信息")
    # logging.warning("警告信息")
    # logging.error("错误信息")
    #
    # 使用current_app输出日志信息，和上面的日志比较：有华丽分割线
    # current_app.logger.debug("调试信息2")
    # current_app.logger.info("详细信息2")
    # current_app.logger.warning("警告信息2")
    # current_app.logger.error("详细错误2")
    return render_template("news/index.html")
@index_blue.route("/favicon.ico")
def web_logo():
    return current_app.send_static_file("news/favicon.ico")